<?php
  // dsm($dt_data);
  global $base_url;
  $json = array();
  foreach($dt_data as $key => $node) {

   // precess data
    $course_thumbnail = field_get_items('node', $node, 'field_course_thumbnail');
    $course_thumbnail = reset($course_thumbnail);
    $thumb = image_style_url('course_feed', $course_thumbnail['uri']);

    $course_price = field_get_items('node', $node, 'field_course_price');
    $course_price = reset($course_price);

    // json encode
    $json[$key]['title'] = $node->title;
    $json[$key]['url'] = $base_url.'/node/'.$node->nid;
    $json[$key]['thumbnail'] = $thumb;
    $json[$key]['price'] = $course_price['value'];
  }
  $json = drupal_json_encode($json);
  print $json;
?>
